package com.tengju.motivation.domain.model.performance;

import java.util.Arrays;

/**
 * @author: 李大仙
 * @date: 2021/7/22 3:14 下午
 */
public enum MotivationActivityConfigObjectTypeEnum {

    SEC(1, "SEC"),
    ;
    private Integer code;
    private String desc;

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    MotivationActivityConfigObjectTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static MotivationActivityConfigObjectTypeEnum form(Integer code) {
        return Arrays.stream(MotivationActivityConfigObjectTypeEnum.values())
                .filter(k -> k.getCode().equals(code))
                .findFirst().orElse(null);
    }
}
